package com.eies.workflow.message;

import com.digitalchina.message.render.MessageRender;
import com.digitalchina.message.render.RenderContext;
import ctais.business.common.xtservice.McDictionaryService;

public class DemoTodoTopicMessageRender implements MessageRender
{
	public Object rend(Object value, RenderContext context)
	{
		String TOPICURL = (String)context.getDataWindow().getItemAny(context.getRowNum(), "TOPICURL");
		TOPICURL=TOPICURL.replace("#", "&");
		String ALLOW_DELETE = (String)context.getDataWindow().getItemAny(context.getRowNum(), "ALLOWDELETE");
		String ID = (String)context.getDataWindow().getItemAny(context.getRowNum(), "TYPE");
		String SYSTEMNAME = (String)context.getDataWindow().getItemAny(context.getRowNum(), "SYSTEMNAME");
		String baseurl = null;
		try {
		     baseurl = McDictionaryService.getInstance().translateDmAny("QX_SYSTEM", "BASEURL", "SYSTEMNAME", SYSTEMNAME, null, null);
		 }
		 catch (Exception e) {
		  e.printStackTrace();
		 }
		 if (baseurl == null) {
		  baseurl = "/ctais";
		}
		 String topic = "&lt;a href=\"javascript:todo_task_onlink('" + baseurl + "','" + ID + "','" + TOPICURL + "','" + value + "','" + ALLOW_DELETE + "','" + SYSTEMNAME + "')\"&gt;" + value + "&lt;/a&gt;";
		 return topic;
	   }
	}
